/* 
 * File:   pricing.h
 * Author: groupe1
 *
 * Created on 11 novembre 2008, 13:09
 */

# include <vector>

#ifndef _PRICING_H
#define	_PRICING_H

class Pricer {
	protected:
		double max2 (double a, double b) ;
		double max3(double a, double b, double c) ;
	public:
		virtual double calcul_prix(int periode, std::vector<double> ind0, std::vector<double> indt, 
			std::vector<double> moy_perf_pan_t, double t, double T, int nbsim, std::vector<double> sigma,double r) = 0 ;
		
		virtual double graph_prix(int nbsim,int periode,std::vector<double> sigma,std::vector<double> mu, std::vector<double> ind0,double r,double T, double eps) = 0;
		virtual void calcul_delta(int periode, std::vector<double> ind0,std::vector<double> indt, 
			std::vector<double> moy_perf_pan_t, double t, double T, int nbsim, std::vector<double> sigma,double r, double eps)=0;

};


class MonteCarlo : public Pricer {
	private:
		double alea() ;
		double gauss_BoxMuller() ;
	public:
		double calcul_prix(int periode, std::vector<double> ind0,std::vector<double> indt, 
			std::vector<double> moy_perf_pan_t, double t, double T, int nbsim, std::vector<double> sigma,double r);
		
		void calcul_delta(int periode, std::vector<double> ind0,std::vector<double> indt, 
			std::vector<double> moy_perf_pan_t, double t, double T, int nbsim, std::vector<double> sigma,double r, double eps);
		
		double graph_prix(int nbsim,int periode,std::vector<double> sigma,std::vector<double> mu, std::vector<double> ind0,double r,double T, double eps);
};

#endif

